﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Principal.Master" AutoEventWireup="true" CodeBehind="Servidores.aspx.cs" Inherits="ProyectoSalvadorDelMundo.CatalogosGrupales.Servidores.Servidores" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="contenidoPrincipal" runat="server">
<form id="form1" runat="server">
        <asp:ToolkitScriptManager ID="toolkitdcriptmanager" runat="server" EnablePartialRendering="true">
        </asp:ToolkitScriptManager>
        <ul class="breadcrumb">
            <li>
                <asp:HyperLink ID="linkNav" runat="server"></asp:HyperLink>
                <span class="divider">/</span>
            </li>
            <li>
                <asp:Label ID="lblNavActiva" runat="server"></asp:Label>
            </li>
        </ul>
        <div>
            <div>
                <h3>
                    <asp:Label ID="lblTitulo" runat="server"></asp:Label>
                </h3>
            </div>
            <div class="contentDiv">
                <div class="gridWrapper">
                    <div>
                    </div>

                    <div class="gridContainer">
                        <asp:UpdatePanel ID="udp" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div class="input-group">
                                    <div class="input-group-btn">
                                        <asp:Button ID="btnAgregar" runat="server" OnClick="Agregar" CausesValidation="false" />&nbsp;&nbsp;
                                        <asp:ImageButton ID="btnBuscar" runat="server" OnClick="Buscar" />
                                    </div>
                                    <asp:TextBox ID="txtBuscar" runat="server" />
                                </div>
                                <br />
                                <div class="form-group">
                                    <asp:Label ID="lblMinisterio" runat="server" AssociatedControlID="ddl"></asp:Label>
                                    <div class="col-sm-5">
                                        <asp:DropDownList ID="ddl" runat="server" OnSelectedIndexChanged="ddl_SelectedIndexChanged" CausesValidation="False" AutoPostBack="True"></asp:DropDownList>
                                    </div>
                                </div>
                                <asp:ListView ID="lsvLista" runat="server" GroupPlaceholderID="groupPlaceHolder1" ItemPlaceholderID="itemPlaceHolder1" OnPagePropertiesChanging="OnPagePropertiesChanging">
                                    <LayoutTemplate>
                                        <table class="table table-striped table-bordered table-condensed table-hover">
                                            <tr>
                                                <td style="width: 0px; display: none">ID</td>
<%--                                                <td style="width: 150px;">Foto
                                                </td>--%>
                                                <td>Asamblea
                                                </td>
                                                <td>Nombre
                                                </td>
                                                <th style="width: 200px;">Editar / Eliminar / Servicios
                                                </th>
                                            </tr>
                                            <asp:PlaceHolder runat="server" ID="groupPlaceHolder1"></asp:PlaceHolder>
                                            <tr>
                                                <td colspan="5">
                                                    <asp:DataPager ID="DataPager1" runat="server" PageSize="10" PagedControlID="lsvLista">
                                                        <Fields>
                                                            <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="Primero" ShowFirstPageButton="true" PreviousPageText="Anterior" ShowPreviousPageButton="true" ShowNextPageButton="false" ShowLastPageButton="false" ButtonCssClass="navbar-link" />
                                                            <asp:NumericPagerField ButtonType="Link" NumericButtonCssClass="navbar-link" />
                                                            <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="false" ShowPreviousPageButton="false" NextPageText="Siguiente" ShowNextPageButton="true" LastPageText="Ultimo" ShowLastPageButton="true" ButtonCssClass="navbar-link" />
                                                        </Fields>
                                                    </asp:DataPager>
                                                </td>
                                            </tr>
                                        </table>
                                    </LayoutTemplate>
                                    <GroupTemplate>
                                        <tr>
                                            <asp:PlaceHolder runat="server" ID="itemPlaceHolder1"></asp:PlaceHolder>
                                        </tr>
                                    </GroupTemplate>
                                    <EmptyDataTemplate>
                                        <table runat="server">
                                            <tr>
                                                <td>
                                                    <h1>No se encontraron registros.</h1>
                                                </td>
                                            </tr>
                                        </table>
                                    </EmptyDataTemplate>
                                    <ItemTemplate>
                                        <td style="width: 0px; display: none">
                                            <asp:Label ID="ID" runat="server" Text='<%# Eval ("id_servidor") %>'></asp:Label>
                                        </td>
<%--                                        <td>
                                            <asp:Image ID="FOTO" runat="server" ImageUrl='<%# "~/ShowImage.ashx?id=" + Eval ("id_servidor") %>' /><asp:FileUpload ID="IMAGE" runat="server" AllowMultiple="false"  />
                                        </td>--%>
                                        <td>
                                            <br />
                                            <asp:Label ID="ASAMBLEA" runat="server" Text='<%# Eval ("NombreAsamblea") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <br />
                                            <span style="font-weight: bold;">Nombre</span> &nbsp;<asp:Label ID="NOMBRE" runat="server" Text='<%# Eval ("nombre") %>'></asp:Label><br />
                                            <span style="font-weight: bold;">Apellido:</span> &nbsp;<asp:Label ID="APELLIDO" runat="server" Text='<%# Eval ("apellido") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <br />
                                            <asp:LinkButton ID="linEditar" runat="server" OnClick="Editar" CausesValidation="false">Editar</asp:LinkButton>
                                            <asp:LinkButton ID="linEliminar" runat="server" OnClick="Eliminar" CausesValidation="false">Eliminar</asp:LinkButton>
                                            <asp:LinkButton ID="linServicios" runat="server" OnClick="ModificarServicios" CausesValidation="false">Servicios</asp:LinkButton>
                                        </td>
                                    </ItemTemplate>
                                </asp:ListView>
                                <asp:HyperLink ID="linkIrMinisterios" runat="server" CssClass="link" NavigateUrl="~/CatalogosGlobales/Ministerios/Ministerios.aspx"></asp:HyperLink>
                                <asp:Panel ID="pnlAgregarEditar" runat="server" >
                                    <div class="modal-content">
                                        <asp:UpdatePanel ID="UpdatePanelPoUp" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <div class="modal-header">
                                                    <asp:Button ID="btnPopX" runat="server" CausesValidation="false" OnClick="CerrarPop" />
                                                    <h4>
                                                        <asp:Label ID="lblPopupTitulo" runat="server"></asp:Label>
                                                    </h4>
                                                </div>
                                                <div class="modal-body" style="height: 600px; overflow-y: scroll;">
                                                    <div class="form-horizontal">

                                                        <div class="form-group">
                                                            <div class="col-sm-12">
                                                                <asp:TextBox ID="txtId" runat="server" Style="width: 0px; display: none"></asp:TextBox>
                                                                <asp:Label ID="lblAccion" runat="server"></asp:Label>
                                                            </div>
                                                        </div>
<%--                                                        <div class="form-group">
                                                            <asp:Label ID="lblFoto" runat="server"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:TextBox ID="txtFoto" runat="server"></asp:TextBox>

                                                                <asp:UpdatePanel ID="UpdatePanelPoUpImg" runat="server" UpdateMode="Conditional">
                                                                    <ContentTemplate>
                                                                        <asp:FileUpload ID="FileUpload1" runat="server" />
                                                                        <asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" />
                                                                        <asp:Image ID="imgView" runat="server" />
                                                                    </ContentTemplate>
                                                                    <Triggers>
                                                                        <asp:AsyncPostBackTrigger ControlID="btnUpload" />
                                                                    </Triggers>
                                                                </asp:UpdatePanel>
                                                            </div>
                                                        </div>--%>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblNombre" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:TextBox ID="txtNombre" runat="server"></asp:TextBox>
                                                            </div>
                                                            <asp:Label ID="lblApellido" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:TextBox ID="txtApellido" runat="server"></asp:TextBox>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblGenero" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:DropDownList ID="ddlGenero" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSexo_SelectedIndexChanged">
                                                                    <asp:ListItem>Masculino</asp:ListItem>
                                                                    <asp:ListItem>Femenino</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </div>
                                                            <asp:Label ID="lblFechaNacimiento" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:TextBox ID="txtFechaNacimiento" runat="server" ></asp:TextBox>
                                                            </div>
                                                        </div>

                                                        <div class="form-group">
                                                            <asp:Label ID="lblDireccion" runat="server"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:TextBox ID="txtDireccion" runat="server"></asp:TextBox>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblDepartamento" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:DropDownList ID="ddlDepartamento" runat="server" CausesValidation="False" AutoPostBack="True" OnSelectedIndexChanged="ddlDepartamentos_SelectedIndexChanged"></asp:DropDownList>
                                                            </div>
                                                            <asp:Label ID="lblMunicipio" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:DropDownList ID="ddlMunicipio" runat="server" CausesValidation="False" AutoPostBack="False" ></asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblCorreo" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:TextBox ID="txtCorreo" runat="server" ></asp:TextBox>
                                                            </div>
                                                            <asp:Label ID="lblEstadoCivil" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:DropDownList ID="ddlEstadoCivil" runat="server" CausesValidation="False" AutoPostBack="True" OnSelectedIndexChanged="ddlEstadoCivil_SelectedIndexChanged"></asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblParejaServidor" runat="server"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:DropDownList ID="ddlParejaServidor" runat="server" CausesValidation="False" AutoPostBack="True"></asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblAsamblea" runat="server"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:DropDownList ID="ddlAsamblea" runat="server" CausesValidation="False" AutoPostBack="False"></asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblFechaConversion" runat="server"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:TextBox ID="txtFechaConversion" runat="server" ></asp:TextBox>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblMinisterioServidor" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:DropDownList ID="ddlMinisterio" runat="server" CausesValidation="False" AutoPostBack="True" OnSelectedIndexChanged="ddlMinisterio_SelectedIndexChanged"></asp:DropDownList>
                                                            </div>
                                                            <asp:Label ID="lblBrazoMinisterio" runat="server"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:DropDownList ID="ddlBrazoMinisterio" runat="server" CausesValidation="False" AutoPostBack="False"></asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblComision" runat="server"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:DropDownList ID="ddlComision" runat="server" CausesValidation="False" AutoPostBack="False"></asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblBarca" runat="server"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:DropDownList ID="ddlBarca" runat="server" CausesValidation="False" AutoPostBack="False"></asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblPastorServidor" runat="server"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:DropDownList ID="ddlPastorServidor" runat="server" CausesValidation="False" AutoPostBack="False"></asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblUsuario" runat="server" Visible="False"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:TextBox ID="txtUsuario" runat="server" Visible="False"></asp:TextBox>
                                                            </div>
                                                            <asp:Label ID="lblContraseña" runat="server" Visible="False"></asp:Label>
                                                            <div class="col-sm-4">
                                                                <asp:TextBox ID="txtContraseña" runat="server" Visible="False"></asp:TextBox>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblGrupoSeguridad" runat="server" Visible="False"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:DropDownList ID="ddlGrupoSeguridad" runat="server" CausesValidation="False" AutoPostBack="False" Visible="False"></asp:DropDownList>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <div class="col-sm-2">
                                                            </div>
                                                            <asp:Label ID="lblEsPermanente" runat="server"></asp:Label>
                                                            <div class="col-sm-1">
                                                                <asp:CheckBox ID="chkEsPermanente" runat="server" />
                                                            </div>
                                                            <asp:Label ID="lblEsAnciano" runat="server"></asp:Label>
                                                            <div class="col-sm-1">
                                                                <asp:CheckBox ID="chkEsAnciano" runat="server" />
                                                            </div>
                                                            <asp:Label ID="lblEsActivo" runat="server"></asp:Label>
                                                            <div class="col-sm-1">
                                                                <asp:CheckBox ID="chkEsActivo" runat="server" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="modal-footer">
                                                    <asp:Button ID="btnPopCerrar" runat="server" CausesValidation="false" OnClick="CerrarPop" />
                                                    <asp:Button ID="btnPopGuardar" runat="server" OnClick="Guardar" />
                                                </div>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="btnPopCerrar"  />
                                                <asp:AsyncPostBackTrigger ControlID="btnPopGuardar"  />
                                                <asp:AsyncPostBackTrigger ControlID="btnPopX"  />
                                                 
                                            </Triggers>
                                        </asp:UpdatePanel>
                                    </div>
                                </asp:Panel>
                                <asp:LinkButton ID="lnkFalso" runat="server"></asp:LinkButton>
                                <asp:ModalPopupExtender ID="popup" runat="server" DropShadow="False"
                                    PopupControlID="pnlAgregarEditar" TargetControlID="lnkFalso"
                                    BackgroundCssClass="modalBackground">
                                </asp:ModalPopupExtender>
                                </span>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="lsvLista" />
                                <asp:AsyncPostBackTrigger ControlID="btnPopGuardar" />
                                <asp:AsyncPostBackTrigger ControlID="btnBuscar" />
                                <asp:AsyncPostBackTrigger ControlID="ddl" EventName="selectedindexchanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                        <asp:UpdateProgress ID="updateprogress" runat="server" AssociatedUpdatePanelID="udp">
                            <ProgressTemplate>
                                <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999996; background-color: #000000; opacity: 0.7;">
                                    <span style="border-width: 0px; position: fixed; padding: 50px; background-color: #FFFFFF; font-size: 20px; left: 40%; top: 40%;">Cargando ...</span>
                                </div>
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </div>
                </div>
            </div>
        </div>
    </form>
</asp:Content>
